import type { CardItem } from './cardModel';

export type DeckCardItem = Writable<
  Partial<CardItem> & {
    number?: number;
  }
>;

export enum ReviewStatusEnum {
  ING,
  PASS,
  FAIL,
}

export type DeckDetail = {
  id: number; //套牌id
  user_id: number; //用户id
  nickname: string; //用户昵称
  deck_name: string; //套牌名称
  legion: string[];
  ruler: DeckCardItem; //门将列表
  cnt_cards: DeckCardItem[]; // CNT卡牌列表
  other_cards: DeckCardItem[]; //其他卡牌列表
  cards_number: number; // 总牌数
  cnt_cards_number: number; // CNT总牌数
  legend_cards_number: number; // 传奇卡牌数量
  total_level: number; // 总等级
  created_at: number; //创建时间
  updated_at: number; //修改时间
  review_status: ReviewStatusEnum; // 审核状态
};

export type DeckItem = Pick<
  DeckDetail,
  'id' | 'deck_name' | 'legion' | 'created_at' | 'cards_number' | 'review_status'
> & {
  isCheck: boolean;
};

export type DeckList = {
  total: number;
  rows: Array<DeckItem>;
};

export type DeckListQuery = { page: number; page_size: number };

export type CreateDeck = Pick<DeckDetail, 'deck_name' | 'ruler' | 'cnt_cards' | 'other_cards'>;

export type ModifyDeck = Pick<DeckDetail, 'id' | 'deck_name' | 'ruler' | 'cnt_cards' | 'other_cards'>;
